<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.0.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css" integrity="sha256-2H3fkXt6FEmrReK448mDVGKb3WW2ZZw35gI7vqHOE4Y=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Gemini","version":"8.7.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":true,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>
<meta name="description" content="Vim + VScode &#x2F; WebStorm使用 vim 快捷键的好处：  提高效率。 统一 WebStorm（JetBrains 系列软件） 和 VScode 的快捷键操作。">
<meta property="og:type" content="article">
<meta property="og:title" content="vim + Vscode &#x2F; WebStorm">
<meta property="og:url" content="http://example.com/2023/03/07/00/index.html">
<meta property="og:site_name" content="Xiaolong&#39;s Blog">
<meta property="og:description" content="Vim + VScode &#x2F; WebStorm使用 vim 快捷键的好处：  提高效率。 统一 WebStorm（JetBrains 系列软件） 和 VScode 的快捷键操作。">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180230.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180523.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180631.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180700.png">
<meta property="article:published_time" content="2023-03-06T16:00:00.000Z">
<meta property="article:modified_time" content="2023-06-27T03:18:24.912Z">
<meta property="article:author" content="Xiaolong">
<meta property="article:tag" content="vim">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180230.png">


<link rel="canonical" href="http://example.com/2023/03/07/00/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"http://example.com/2023/03/07/00/","path":"2023/03/07/00/","title":"vim + Vscode / WebStorm"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>vim + Vscode / WebStorm | Xiaolong's Blog</title>
  




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Xiaolong's Blog</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a></li>
        <li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags</a></li>
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Vim-VScode-WebStorm"><span class="nav-number">1.</span> <span class="nav-text">Vim + VScode &#x2F; WebStorm</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85%E6%8F%92%E4%BB%B6"><span class="nav-number">1.1.</span> <span class="nav-text">安装插件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE"><span class="nav-number">1.2.</span> <span class="nav-text">配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%85%B1%E4%BA%AB%E7%B3%BB%E7%BB%9F%E5%89%AA%E8%B4%B4%E6%9D%BF"><span class="nav-number">1.3.</span> <span class="nav-text">共享系统剪贴板</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BD%BF%E7%94%A8%E7%BC%96%E8%BE%91%E5%99%A8%E5%BF%AB%E6%8D%B7%E9%94%AE"><span class="nav-number">1.4.</span> <span class="nav-text">使用编辑器快捷键</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#vim-%E5%9B%9B%E7%A7%8D%E6%A8%A1%E5%BC%8F"><span class="nav-number">1.5.</span> <span class="nav-text">vim 四种模式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%91%BD%E4%BB%A4"><span class="nav-number">1.6.</span> <span class="nav-text">命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9F%BA%E7%A1%80%E5%91%BD%E4%BB%A4%EF%BC%9A"><span class="nav-number">1.6.1.</span> <span class="nav-text">基础命令：</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#hjkl"><span class="nav-number">1.6.1.1.</span> <span class="nav-text">hjkl</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#y"><span class="nav-number">1.6.1.2.</span> <span class="nav-text">y</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#yy"><span class="nav-number">1.6.1.3.</span> <span class="nav-text">yy</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#p"><span class="nav-number">1.6.1.4.</span> <span class="nav-text">p</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#x"><span class="nav-number">1.6.1.5.</span> <span class="nav-text">x</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#dd"><span class="nav-number">1.6.1.6.</span> <span class="nav-text">dd</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#e-b"><span class="nav-number">1.6.1.7.</span> <span class="nav-text">e &#x2F; b</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#gg-G"><span class="nav-number">1.6.1.8.</span> <span class="nav-text">gg &#x2F; G</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#zz-zt-zb"><span class="nav-number">1.6.1.9.</span> <span class="nav-text">zz &#x2F; zt &#x2F; zb</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#J%EF%BC%88%E5%A4%A7%E5%86%99%EF%BC%89"><span class="nav-number">1.6.1.10.</span> <span class="nav-text">J（大写）</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BB%84%E5%90%88%E5%91%BD%E4%BB%A4%EF%BC%9A"><span class="nav-number">1.6.2.</span> <span class="nav-text">组合命令：</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#dit"><span class="nav-number">1.6.2.1.</span> <span class="nav-text">dit</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#di-di"><span class="nav-number">1.6.2.2.</span> <span class="nav-text">di( &#x2F; di{</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#di%E2%80%99-di%E2%80%9D"><span class="nav-number">1.6.2.3.</span> <span class="nav-text">di’ &#x2F; di”</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BF%AE%E6%94%B9%E9%94%AE%E7%9B%98%E6%98%A0%E5%B0%84%EF%BC%88window%EF%BC%89"><span class="nav-number">1.7.</span> <span class="nav-text">修改键盘映射（window）</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%BF%AE%E6%94%B9"><span class="nav-number">1.7.0.1.</span> <span class="nav-text">修改</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%A4%8D%E5%8E%9F"><span class="nav-number">1.7.0.2.</span> <span class="nav-text">复原</span></a></li></ol></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-overview">
            <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Xiaolong"
      src="/images/lion.jpg">
  <p class="site-author-name" itemprop="name">Xiaolong</p>
  <div class="site-description" itemprop="description">Never stop learning</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">45</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">17</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/drwna" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;drwna" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>



          </div>
        </div>
      </div>
        <div class="back-to-top animated" role="button" aria-label="Back to top">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/Drwna" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/03/07/00/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/lion.jpg">
      <meta itemprop="name" content="Xiaolong">
      <meta itemprop="description" content="Never stop learning">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Xiaolong's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          vim + Vscode / WebStorm
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2023-03-07 00:00:00" itemprop="dateCreated datePublished" datetime="2023-03-07T00:00:00+08:00">2023-03-07</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="Vim-VScode-WebStorm"><a href="#Vim-VScode-WebStorm" class="headerlink" title="Vim + VScode / WebStorm"></a>Vim + VScode / WebStorm</h1><p>使用 vim 快捷键的好处：</p>
<ol>
<li>提高效率。</li>
<li>统一 WebStorm（JetBrains 系列软件） 和 VScode 的快捷键操作。</li>
</ol>
<span id="more"></span>

<h2 id="安装插件"><a href="#安装插件" class="headerlink" title="安装插件"></a>安装插件</h2><ol>
<li><strong>VScode</strong></li>
</ol>
<p>​    插件市场搜索 [vim](<a target="_blank" rel="noopener" href="https://marketplace.visualstudio.com/items?itemName=vscodevim.vim">Vim - Visual Studio Marketplace</a>) , 安装。</p>
<ol start="2">
<li><strong>WebStorm（JetBrains 系列软件都可使用）</strong> </li>
</ol>
<p>​    插件市场搜索 <a target="_blank" rel="noopener" href="https://plugins.jetbrains.com/plugin/164-ideavim">IdeaVim</a> , 安装。</p>
<h2 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h2><h2 id="共享系统剪贴板"><a href="#共享系统剪贴板" class="headerlink" title="共享系统剪贴板"></a>共享系统剪贴板</h2><p>vim 复制的内容无法复制到系统的剪贴板中，需要配置才能使用。</p>
<ol>
<li><p><strong>webStorm</strong></p>
<ol>
<li>在用户根目录创建 <code>.vimrc</code></li>
</ol>
 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">set</span> clipboard=unnamed</span><br></pre></td></tr></table></figure>

<ol start="2">
<li>在用户根目录创建 <code>.ideavimrc</code></li>
</ol>
 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">source</span> ~/.vimrc</span><br><span class="line"><span class="built_in">set</span> ideajoin</span><br><span class="line"><span class="built_in">set</span> clipboard+=ideaput</span><br></pre></td></tr></table></figure></li>
<li><p><strong>vscode 无需配置</strong></p>
</li>
</ol>
<p>更多个性化配置可在 <code>.vimrc</code> 中配置。</p>
<h2 id="使用编辑器快捷键"><a href="#使用编辑器快捷键" class="headerlink" title="使用编辑器快捷键"></a>使用编辑器快捷键</h2><p>安装 vim 插件后，插件会接管所有快捷键，一些常用的快捷键会被映射为 vim 的操作</p>
<p>但又需要使用原本编辑这些快捷键，例如：搜索（ctrl + f）、全选（ctrl + a）等。</p>
<ol>
<li><p><strong>vscode</strong></p>
<p>在 settings.json 中添加：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">&quot;vim.handleKeys&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-a&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span> <span class="comment">// ctrl + a</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-x&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span> <span class="comment">// ctrl + x</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-c&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span> <span class="comment">// ...</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-f&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-n&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-w&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span></span><br><span class="line">	<span class="attr">&quot;&lt;C-b&gt;&quot;</span><span class="punctuation">:</span> <span class="keyword">false</span><span class="punctuation">,</span></span><br><span class="line"><span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line"><span class="comment">// ctrl + ... 这些快捷键会使用 vscode 的操作</span></span><br></pre></td></tr></table></figure></li>
<li><p><strong>webstorm</strong></p>
<p>emm… 忘了</p>
</li>
</ol>
<h2 id="vim-四种模式"><a href="#vim-四种模式" class="headerlink" title="vim 四种模式"></a>vim 四种模式</h2><p>Vim 是一款非常强大的文本编辑器，它有四种不同的模式：普通模式、插入模式、可视模式和命令行模式。下面对这四种模式进行详细地介绍：</p>
<ol>
<li><p><strong>普通模式（Normal Mode</strong>）：</p>
<p>普通模式是 Vim 启动后默认的模式。在这个模式下，你可以使用不同的命令来对文本进行操作。</p>
<p>例如，可以使用 h、j、k 和 l 键在文本中移动；</p>
<p>使用 dd 将一行文本删除，使用 yy 将一行文本复制，等等。</p>
<p>普通模式下不会出现光标闪烁。按下 i 或 a 可以进入插入模式。</p>
</li>
<li><p><strong>插入模式（Insert Mode</strong>）：</p>
<p>插入模式下，可以像在其他文本编辑器中一样编辑文本。</p>
<p>进入此模式方法：</p>
<ol>
<li>小写 i，大写 I。</li>
<li>小写 a，大写 A。</li>
</ol>
<p>按 <code>ESC</code> 返回普通模式。</p>
</li>
<li><p><strong>可视模式（Visual Mode）</strong>：</p>
<p>在可视模式下，可以使用不同的命令来选择文本。</p>
<p>进入此模式方法：</p>
<ol>
<li>小写 v，自由选择区域。</li>
<li>大写 V，整行的选择。</li>
</ol>
<p>选择后可以进行复制、删除等操作。</p>
<p>按 <code>ESC</code> 返回普通模式。</p>
</li>
<li><p><strong>命令行模式（Command-line Mode）</strong>：</p>
<p>在普通模式下按下冒号 (:) 将进入命令行模式。</p>
<p>在这个模式下，可以执行一些高级的操作，例如打开文件、保存文件、退出 Vim 等。</p>
<p>此模式下常用命令：<code>wq</code> 保存并退出，<code>w</code>保存，<code>q!</code>强制退出</p>
<p>按 <code>ESC</code> 返回普通模式。</p>
</li>
</ol>
<h2 id="命令"><a href="#命令" class="headerlink" title="命令"></a>命令</h2><h3 id="基础命令："><a href="#基础命令：" class="headerlink" title="基础命令："></a>基础命令：</h3><h4 id="hjkl"><a href="#hjkl" class="headerlink" title="hjkl"></a>hjkl</h4><p>上：<code>k</code></p>
<p>下：<code>j</code></p>
<p>左：<code>h</code></p>
<p>右：<code>l</code></p>
<h4 id="y"><a href="#y" class="headerlink" title="y"></a>y</h4><p>复制，可以用来复制指定的文本。</p>
<h4 id="yy"><a href="#yy" class="headerlink" title="yy"></a>yy</h4><p>复制当前行，可以将当前光标所在的行复制到剪贴板中。</p>
<h4 id="p"><a href="#p" class="headerlink" title="p"></a>p</h4><p>粘贴，将之前复制或剪切到剪贴板中的内容粘贴到当前光标所在位置后面。</p>
<h4 id="x"><a href="#x" class="headerlink" title="x"></a>x</h4><p>删除命令，用来删除光标所在位置处的一个字符。</p>
<h4 id="dd"><a href="#dd" class="headerlink" title="dd"></a>dd</h4><p>删除一整行。具体来说，可以通过以下操作实现：</p>
<p>如果在执行 dd 命令之前输入了数字 n，那么会删除当前行及其后面的 n - 1 行。比如执行 3dd 命令会删除当前行及其下面的两行。</p>
<h4 id="e-b"><a href="#e-b" class="headerlink" title="e / b"></a>e / b</h4><p>用于移动光标到单词的开头 / 结尾。</p>
<ul>
<li><p><code>b</code> 命令表示将光标移动到当前单词的开头。</p>
</li>
<li><p><code>e</code> 命令表示将光标移动到当前单词的结尾。</p>
</li>
</ul>
<p>这两个命令通常用于快速跳转到当前单词的开头或结尾，便于对单词进行编辑操作，如复制、删除、替换等。</p>
<h4 id="gg-G"><a href="#gg-G" class="headerlink" title="gg / G"></a>gg / G</h4><ul>
<li><p><code>gg</code> 用于将光标移动到文件的第一行。</p>
</li>
<li><p><code>G</code> 用于将光标移动到文件的最后一行。</p>
</li>
</ul>
<p>这两个命令通常用于快速跳转到文件的开头或结尾，便于查看或编辑文本。</p>
<p>另外，还可以加上数字前缀，如 <code>10G</code> 可以将光标移动到文本的第 10 行，<code>2gg</code> 可以将光标移动到文本的第二行</p>
<h4 id="zz-zt-zb"><a href="#zz-zt-zb" class="headerlink" title="zz / zt / zb"></a>zz / zt / zb</h4><p>用于将当前行移动到窗口的中间位置。</p>
<p>具体来说，它会将当前行移动到屏幕的中间，以便更好地查看当前行上下文的内容。</p>
<p>该命令对于浏览较长的文件很有用，可以避免连续滚动以查看当前行的上下文。</p>
<p>如果你正在编辑一份文档，并且需要将某个地方的内容移到窗口的中间，那么可以使用 <code>zz</code> 命令轻松实现这一目的。</p>
<p>除了 <code>zz</code> 命令外，还可以使用 <code>zt</code> 将当前行移动到屏幕的顶部，或者使用 <code>zb</code> 将当前行移动到屏幕的底部。</p>
<h4 id="J（大写）"><a href="#J（大写）" class="headerlink" title="J（大写）"></a>J（大写）</h4><p>用于将当前行与下一行合并为一行。</p>
<p>具体来说，它会删除当前行和下一行之间的换行符，并将它们合并成一行。</p>
<p>该命令对于快速将两行文本合并为一行很有用。</p>
<p>如果你需要将多个短语或句子合并成一行，可以使用 J 命令轻松实现这一目的。</p>
<h3 id="组合命令："><a href="#组合命令：" class="headerlink" title="组合命令："></a>组合命令：</h3><p><code>daw</code> 删除光标所在的单词及其周围的空格。</p>
<p><code>diw</code> 删除光标所在的单词。</p>
<p><a target="_blank" rel="noopener" href="https://stackoverflow.com/questions/20416162/is-there-any-difference-between-dw-and-daw-in-vim">daw 和 diw 的区别</a></p>
<p><code>dw</code> 删除光标所在位置到单词结尾的单词和单词后的一个空格。</p>
<p><code>cw</code> 删除光标所在位置到单词结尾的单词和单词后的一个空格，并进入插入模式。</p>
<h4 id="dit"><a href="#dit" class="headerlink" title="dit"></a>dit</h4><p>用于删除当前所在 HTML/XML 标签的内容。</p>
<p>其中 d 表示删除操作，it 表示内部标签（inner tag），表示删除当前光标所在标签中间的内容。</p>
<p>具体来说，它会将当前光标定位到所在标签的内部，然后删除整个标签内的内容以及该标签本身，并将其存储在剪贴板中，以供后续使用。</p>
<p>这个命令通常用于快速删除 HTML 或 XML 文件中的特定标签及其内容。</p>
<h4 id="di-di"><a href="#di-di" class="headerlink" title="di( / di{"></a>di( / di{</h4><p>用于删除当前圆括号 () 之间的内容。</p>
<p>其中 d 表示删除操作，i( 表示内部括号（inner parenthesis），表示删除当前光标所在位置所包含的一对圆括号 () 之间的内容。</p>
<p>具体来说，它会将当前光标定位到所在括号的内部，然后删除括号内的所有内容，并将其存储在剪贴板中，以供后续使用。</p>
<p>这个命令通常用于快速删除一对圆括号 () 中的文本内容。</p>
<h4 id="di’-di”"><a href="#di’-di”" class="headerlink" title="di’ / di”"></a>di’ / di”</h4><p>用于删除当前单引号 ‘’ 之间的内容。</p>
<p>其中 d 表示删除操作，i’ 表示内部引号（inner quote），表示删除当前光标所在位置所包含的一对单引号 ‘’ 之间的内容。</p>
<p>具体来说，它会将当前光标定位到所在字符串的内部，然后删除该字符串中的所有内容，并将其存储在剪贴板中，以供后续使用。</p>
<p>这个命令通常用于快速删除一对单引号 ‘’ 中的字符串文字。</p>
<h2 id="修改键盘映射（window）"><a href="#修改键盘映射（window）" class="headerlink" title="修改键盘映射（window）"></a>修改键盘映射（window）</h2><p>Esc 键使用频率很高，手移动太大，不方便故将 Caps Lock 键映射为 Esc 键。</p>
<h4 id="修改"><a href="#修改" class="headerlink" title="修改"></a>修改</h4><p>chatGPT 提供的步骤：</p>
<p>以下是使用 SharpKeys 将 Caps Lock 键映射为 Esc 键的步骤：</p>
<ol>
<li>首先，下载并安装 <a target="_blank" rel="noopener" href="https://github.com/randyrants/sharpkeys/">SharpKeys</a>。你可以在 SharpKeys 的 GitHub 页面上找到最新的发行版。</li>
<li>启动 SharpKeys，并点击“Add”按钮。</li>
<li>在“Map this key (from key)”下拉列表中选择“Special: Caps Lock”。</li>
<li>在“To this key (to key)”下拉列表中选择“Special: Escape”。</li>
<li>点击“OK”按钮，然后点击“Write to Registry”按钮。</li>
<li>最后，重新启动电脑，使更改生效。</li>
</ol>
<p>完成以上步骤后，你的 Caps Lock 键就会被映射为 Esc 键了。这样，你就可以更方便地在 Vim 或其他编辑器中进行快速的光标移动了。</p>
<p>软件主界面</p>
<center><img src="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180230.png" alt="20230411180230" width="600px"></center>



<p><strong>step 1</strong></p>
<center><img src="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180523.png" alt="20230411180523" width="600px"></center>



<p><strong>step2</strong></p>
<center><img src="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180631.png" alt="20230411180631" width="600px"></center>



<p><strong>step3</strong></p>
<center><img src="https://cdn.jsdelivr.net/gh/Drwna/image//images/20230411180700.png" alt="20230411180700" width="600px"></center>



<h4 id="复原"><a href="#复原" class="headerlink" title="复原"></a>复原</h4><p>chatGPT 提供：</p>
<p>如果你使用了 SharpKeys 将 Caps Lock 键映射为 Esc 键，想要恢复原来的功能，可以按照以下步骤操作：</p>
<ol>
<li>启动 SharpKeys。</li>
<li>在 SharpKeys 界面中找到你之前创建的键盘映射，然后选中它。</li>
<li>点击“Delete”按钮，确认删除键盘映射。</li>
<li>点击“Write to Registry”按钮，保存更改。</li>
<li>最后，重新启动电脑，使更改生效。</li>
</ol>
<p>完成以上步骤后，Caps Lock 键的功能就会恢复为原来的状态。</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/vim/" rel="tag"><i class="fa fa-tag"></i> vim</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2023/01/26/00/" rel="prev" title="Uniapp 开发记录">
                  <i class="fa fa-chevron-left"></i> Uniapp 开发记录
                </a>
            </div>
            <div class="post-nav-item">
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 2021 – 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Xiaolong</span>
</div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  
<script src="/js/third-party/search/local-search.js"></script>




  





</body>
</html>
